<import resource="classpath:alfresco/webscripts/org/alfresco/confluence/util/utils.js">

// Connect to remote Alfresco document service

// Prepare a remote connector to Alfreso service
var alfDocServiceUrl = "/api";

if ( args.id != null ) {

	alfDocServiceUrl += "/node/content/"+args.id.replace(":/", "");

}

if ( args.path != null ) {

	alfDocServiceUrl += "/path/content/workspace/SpacesStore"+escape(args.path);

}

var alfEndpoint = CMISUtils.endpoint.getEndpoint();

var connector = remote.connect(alfEndpoint);

var result = connector.call(alfDocServiceUrl);

model.result = result.toString();

